// Learn TypeScript:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;


export class player
{
   uid:string
   credit1:string
   nickname:string
   avatar:string
   rank:string

}


@ccclass
export default class GameDataInstance extends cc.Component {

    static _instance: GameDataInstance;
    static get Instance() {
        return this._instance || (this._instance = new GameDataInstance());
    }

    windowheigh:number
    windowwidth:number
    
    bannerAd:any
//分数
    Score:number = 0

    //关卡
    guanka:number = 1;

    //游戏开始
    gamestart:boolean = false


    currentnode:cc.Node = null



    //视频广告id
    videoid:any

    //最高分数
    MaxScore:number = 0

    //最高关卡
    Maxguanka:number = 0

    //游戏结束
    gameover:boolean = false

    //转发的图片和url
    titie:string
    thumb:string


    //复活币
    resurgenceNum:number = 2



    //复活开关接口
    kgfuhuo:number = 0

    //赢复活币开关接口
    kgyingfuhuobi = 0

    //悬浮窗开关
    xuanfuchuangkg:number = 0

    //更多游戏开关
    moregamekg:number = 0

    //段位
    duanwei:number = 0


    //openid
    openid:string = null
    //sessionket=y
    sessionKey:string = null

    //签到的天数
    sine_day:number = 0

    //金币
    goldNum:number = 0


    //获取openid 的url
    getopenidUrl:string = 'https://sjh5.88youxi.cn/app/index.php?i=55&c=entry&do=get_tt_openid&m=wxs_api'

    //是否存在openid
    hasopenid:string = 'https://sjh5.88youxi.cn/app/index.php?i=55&c=entry&do=hasopenid&m=wxs_api'

    //用户注册
    updatememberUrl:string = 'https://sjh5.88youxi.cn/app/index.php?i=55&c=entry&do=updatemember&m=wxs_api'

    // //签到url
    // qiandaoUrl:string = 'https://sjh5.88youxi.cn/app/index.php?i=55&c=entry&do=signin_v1&m=wxs_api&'

    //存用户分数url
    updatejifen:string = 'https://sjh5.88youxi.cn/app/index.php?i=55&c=entry&do=update_jifen&m=wxs_api'

    //查询用户分数
    chaxunjifen:string = 'https://sjh5.88youxi.cn/app/index.php?i=55&c=entry&do=member_index&m=wxs_api'

    //排行榜url
    rankviewURL = ''

    //悬浮窗url
    xuanfuchuangurl:string = null

    //悬浮窗的path
    xuanfuchuangpath:string = null


    //更多游戏url
    moregameurl:string = null

    //更多游戏path
    moregamepath:string = null

    //微信可使用屏幕宽度
    windowwidth:number = 0

    //微信可使用屏幕高度
    windowheigh:number = 0

    //图片广告组件
    over_bannerAd:any

    //激励视频广告组件
    rewardedVideoAd1:any

    rewardedVideoAd2:any

    isshow:boolean = false

    //返回排行榜数据
    paihangData:[player]

    //我的世界排行榜数据
    myworldpaihangdata:player

    //我的本地排行
    mylocalpaihangdata:player


    //世界排行数据
    worldpaihangdata:any

    //本地排行数据
    localpaihangdata:any

    //用户是否登陆
    userisLogin:boolean = false

    //倒计时
    tomecount:number = 10

    //是否打开音乐
     voiceon:boolean = true

     //是否正在播放快音乐
     onkuaimusic:boolean = false

     //右上角菜单位置
     menuPosition:any


     //
    // onLoad () {}

    start () {

    }

    // update (dt) {}
}
